package main.java.exception;

public class ThrowDemo {
    public static void main(String[] args) {
        Person p = new Person();
        try {
            p.setAge(1000);//满足语法但是不满足业务
        } catch (Exception e) {
            System.out.println("改年龄不合法，请重新输入");
        }
        System.out.println("此人年龄为："+p.getAge());
    }
}
